package cn.liwq.demo.java.raw.proxy;

import cn.liwq.demo.java.raw.proxy.entry.Foo;
import cn.liwq.demo.java.raw.proxy.entry.impl.FooA;
import cn.liwq.demo.java.raw.proxy.handler.InvocationLoggerHandler;

import java.lang.reflect.Proxy;

/**
 * <p>Project: demo-common </p>
 * <p>Function:  </p>
 * <p>Description:  </p>
 * <p>Copyright: Copyright(c) 2018 Ucarinc </p>
 * <p>Company: Ucarinc </p>
 *
 * @author weiqiang.li@ucarinc.com
 * @version 1.0
 * @date 2018-08-15 17:11:11
 */
public class ProxyDemo {
    public static void main(String[] args) {
        Foo fooProxy = (Foo) Proxy.newProxyInstance(Foo.class.getClassLoader(), new Class[] {Foo.class},
                new InvocationLoggerHandler(new FooA()));
        fooProxy.print("Hello World.");
    }
}
